package com.gca.airhockey;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.entity.sprite.Sprite;
import org.anddev.andengine.opengl.texture.TextureOptions;
import org.anddev.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
import org.anddev.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory;
import org.anddev.andengine.opengl.texture.region.TextureRegion;

import android.content.Context;

public class Table implements IPhysicalObject
{
	private static final String TABLE_IMAGE = "gfx/table.png";
	
	private static final int POS_X = 0;
	private static final int POS_Y = 0;
	
	private BitmapTextureAtlas mTexture;
	private TextureRegion mRegion;
	private Sprite mSprite;
	
	// ===========================================================
	// Constructors
	// ===========================================================
	public Table(Context pContext, Engine engine)
	{
		this.mTexture = new BitmapTextureAtlas(2048,1024 ,TextureOptions.BILINEAR_PREMULTIPLYALPHA);
		this.mRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.mTexture, pContext, TABLE_IMAGE, 0, 0);
		engine.getTextureManager().loadTexture(this.mTexture);
		this.mSprite = new Sprite(POS_X, POS_Y, mRegion);
	}
	
	// ===========================================================
	// Getters and Setters
	// ===========================================================
	public Sprite getSprite()
	{
		return mSprite;
	}
	
	@Override
	public String toString() {
		return "Table";
	}
}
